package com.xuecheng.manage_cms.controller;

import com.xuecheng.api.cms.SysDicthinaryControllerApi;
import com.xuecheng.framework.domain.system.SysDictionary;
import com.xuecheng.manage_cms.service.SysDictionaryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ShengJinFeng
 * @version V1.0
 * @ClassName SysDicthinaryController
 * @Description (这里用一句话描述这个类的作用)
 * @date 2020/2/3 14:56
 * @since V1.0
 */
@RestController
@Api(value = "数据字典接口",description = "提供数据字典接口的管理、查询功能")
@RequestMapping("/sys/dictionary")
public class SysDicthinaryController implements SysDicthinaryControllerApi {

    @Autowired
    private SysDictionaryService sysDictionaryService;

    @Override
    @ApiOperation("根据字典分类type查询字典信息")
    @GetMapping("/get/{type}")
    public SysDictionary getByType(@PathVariable("type") String type) {

        return sysDictionaryService.getByType(type);
    }
}
